package com.zx.mes.hyl.common.msg;

import java.util.List;

/**
 * table封装
 * @author hyl
 * @date 2017-12-16
 */
public class TableResultResponse<T> extends BaseResponse{

    public TableData<T> getData() {
        return data;
    }

    public void setData(TableData<T> data) {
        this.data = data;
    }

    private TableData<T> data=new TableData<>();

    public TableResultResponse(){
        this.data=new TableData<>();
    }

    public TableResultResponse(TableData<T> data) {
        this.data = data;
    }

    /**
     * 常用
     * @param total
     * @param rows
     */
    public TableResultResponse(long total,List<T> rows) {
        this.data = new TableData<>(total,rows);
    }

    class TableData<T>{
        private long total;

        private List<T> rows;

        public TableData(){}

        public TableData(long total, List<T> rows) {
            this.total = total;
            this.rows = rows;
        }

        public long getTotal() {
            return total;
        }

        public void setTotal(long total) {
            this.total = total;
        }

        public List<T> getRows() {
            return rows;
        }

        public void setRows(List<T> rows) {
            this.rows = rows;
        }
    }
}
